The Xon\xoff principle of serial-port handshake protocol Some people may not understand, look at the following example you should be able to understand.
Suppose pc A and PC B communicate via RS232 serial port
A and B are negotiated using the Software Handshake Protocol (DCB.FOUTX = TRUE), defining XonChar \ XoffChar such as XonChar = 1,
XoffChar = 2.
Now, a sends the character 2 to B, and B sends the string "HelloWorld" to a. A can you get the str
Link: fzu 2136 2136 get candy
Question: omitted.
Solution: Merge line segment tree intervals. Sort the bags by number and place the smallest number in the line segment tree each time. If the number of consecutive rows exceeds the interval
The minimum value indicates the number of sweets added to the last bag.
#include
Fzu 2136 get candy (line segment tree)
POJ 2136 Vertical Histogram prints special graphics, pojhistogram
Print the output format as required.
These are some interesting questions. The question itself is not difficult. The difficulty is to test how to program elegantly. It is mainly to test the basic programming skills.
In addition, it seems that the test system is not very strict and does not judge the redundant spaces behind it. According to the requirements of the question, we need to st
Question address: http://acm.zju.edu.cn/onlinejudge/showProblem.do? Problemcode = 2136.
The typical DP is divided into the following subproblem: The record length [k] is, And the AK is the maximum length of the ascending suborder of the last element. When this value is obtained, you only need to retrieve the smaller number before this number to see how long it is and get the largest length.
M records the length of the previous subproblem and is initia
Title Link: http://poj.org/problem?id=2136The water problem WA for half a day, the result is that the array is opened small.#include #includestring.h>Chars[1005];intnum[ -]= {0};intMain () { for(intI=0; i4; i++) {gets (s); intlen=strlen (s); for(intj=0; j) { if(s[j]>='A's[j]'Z') Num[s[j]-'A']++; } } Charmaps[ the*4][ -*2]={0}; memset (Maps,' ',sizeof(maps)); int_max=0; for(intI=0; i -; i++) if(_maxNum[i]) _max=Num[i]; for(intI=0; i) { for(intj=0; j -;
Largest prime factorTime limit:5000/1000 MS (java/others) Memory limit:32768/32768 K (java/others)Total submission (s): 7297 Accepted Submission (s): 2589Problem Descriptioneverybody knows any number can is combined by the prime number.Now, your task was telling me what position of the largest prime factor.The position of Prime 2 is 1, Prime 3 are 2, and Prime 5 is 3, etc.Specially, LPF (1) = 0. Inputeach line would contain one integer n (0 Outputoutput the LPF (n).Sample Input12345Sample Outp
POJ 2136 Vertical Histogram
Analysis: A long time ago, I encountered this question in K R, but it was a little more complicated than this question ....
It's also a water question. There's nothing to say. Pay attention to the details, such as the output format. In addition, the for loop is used at the beginning and printed directly after each input line ends, depressing ^ ~ _~ ^
DescriptionWrite a program to read four lines of upper case (I. e ., al
POJ 2136 Vertical Histogram print special graphics
Print the output format as required.
These are some interesting questions. The question itself is not difficult. The difficulty is to test how to program elegantly. It is mainly to test the basic programming skills.
In addition, it seems that the test system is not very strict and does not judge the redundant spaces behind it. According to the requirements of the question, we need to strictly remove t
Largest prime factorTime limit:5000/1000 MS (java/others) Memory limit:32768/32768 K (java/others)Total submission (s): 9993 Accepted Submission (s): 3528Problem Descriptioneverybody knows any number can is combined by the prime number.Now, your task was telling me what position of the largest prime factor.The position of Prime 2 is 1, Prime 3 are 2, and Prime 5 is 3, etc.Specially, LPF (1) = 0.Inputeach line would contain one integer n (0 Outputoutput the LPF (n).Sample Input12345Sample Output0
Problem Descriptioneverybody knows any number can is combined by the prime number.Now, your task was telling me what position of the largest prime factor.The position of Prime 2 is 1, Prime 3 are 2, and Prime 5 is 3, etc.Specially, LPF (1) = 0.Inputeach line would contain one integer n (0 Outputoutput the LPF (n).Sample Input12345Sample Output01213AuthorwiskeySourcehdu 2007-11 Programming Contest_warmupTest instructions: is the position of the maximum prime factor in the prime number table.1#inc
Build and traverse a binary tree in the data structure experiment of SDUTOJ 2136, sdutoj2136
#include
In our data structure experiment class, we used C ++ to build a binary tree traversal program. The teacher did not talk about how to solve the problem.
In fact, when we use data structures in C and C ++, the difference can be simply the difference between input and output. Therefore, it is completely possible to compile with vc6.0, we all use vc6.0 f
Http://acm.hdu.edu.cn/showproblem.php? PID = 1, 2136
Solution: Use the factorial method to obtain the number of the prime number with the largest N value.
# Include
Assume that computer A and computer B communicate through RS232 serial port
A and B negotiate to use the software handshake protocol (DCB. foutx = true) and define xonchar/xoffchar, for example, xonchar = 1,
Xoffchar = 2.
Now, a sends 2
Print the output format as required. These are some interesting questions. The question itself is not difficult. The difficulty is to test how to program elegantly. It is mainly to test the basic programming skills. In addition, it seems that the
Three methods for prime number table are summarized.
First:
void intline(){ memset(prime,true,sizeof(prime)); prime[1]=false; prime[0]=false; for(int i=2; i*i
Second: similar to the first principle, it is also the method used for this
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.